import 'package:flutter/material.dart';

import 'my_text.dart';

class MyInfo extends StatelessWidget {
  final String? title;
  final String? hintText;
  final double? fontSize;
  final Color? fontColor;
  final Color? hintColor;
  final Color? backgroundColor;
  final bool border;

  final double? height;
  final double? width;
  final Widget child;

  const MyInfo({
    super.key,
    this.title,
    this.hintText,
    this.fontSize,
    this.fontColor,
    this.hintColor,
    this.backgroundColor,
    this.border = false,
    this.height,
    this.width,
    required this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(vertical: 8),
      alignment: Alignment.center,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: [
          Container(
            width: width,
            alignment: Alignment.centerRight,
            child: MyText(
              title ?? "",
              size: fontSize,
              color: fontColor,
            ),
          ),
          child,
        ],
      ),
    );
  }
}
